package com.ttdevs.boot;

import android.content.BroadcastReceiver;
import android.content.Context;
import android.content.Intent;

import com.ttdevs.es.service.MainService;
import com.ttdevs.util.SharePreferenceUtil;
import com.ttdevs.util.StaticConstants;

public class AutoBoot extends BroadcastReceiver implements StaticConstants {

	@Override
	public void onReceive(Context context, Intent intent) {
		if (intent.getAction().equals(AUTOBOOTACTION)) {
			if (new SharePreferenceUtil(context).getRunning()) {
				context.startService(new Intent(context, MainService.class).putExtra(AUTOBOOT, true));
			}
		}
	}
}
